package com.scu.hotelsystem.service;


import com.scu.hotelsystem.dao.VipDao;
import com.scu.hotelsystem.pojo.PageInfo;
import com.scu.hotelsystem.pojo.Vip;
import com.scu.hotelsystem.pojo.VipSearch;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

import static java.awt.SystemColor.info;

@Service
@Transactional
public class VipServiceImpl implements VipService{
    @Autowired
    private VipDao vipDao;

    @Override
    public List<Vip> getVipListByPage(VipSearch info) {
        return vipDao.getVipListByPage((info.getPage()-1)*info.getLimit(),info.getLimit(),info);
    }


    @Override
    public int getVipCount(VipSearch info) {
        return vipDao.getVipCount(info);
    }

    @Override
    public int delVip(Integer guest_id) {
        return vipDao.delVip(guest_id);
    }

    @Override
    public int addVip(Vip vip) {
        return vipDao.addVip(vip);
    }
}
